AC_PREREQ(2.54)

AC_INIT(src/main.c)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET

AC_PROG_MAKE_SET

AM_SANITY_CHECK
AM_INIT_AUTOMAKE(flashShitD, 0.1)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE

AC_PROG_CC
AC_PROG_LN_S
AC_ISC_POSIX
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AM_PROG_CC_STDC

AC_GNU_SOURCE

AC_C_CONST
AC_C_INLINE

AC_HEADER_STDC
AC_HEADER_DIRENT
AC_CHECK_HEADERS(stdio.h sys/stat.h sys/types.h unistd.h string.h)

# GLib:
PKG_CHECK_MODULES(glib, [
  glib-2.0 >= 2.16.0 
  gthread-2.0 >= 2.16.0
])

LDFLAGS="$LDFLAGS $glib_LIBS"
CFLAGS="$CFLAGS $glib_CFLAGS -DG_DISABLE_DEPRECATED -DG_ERRORCHECK_MUTEXES"

CFLAGS="$CFLAGS -Wall"

AC_OUTPUT([
  flashShitD.init
  Makefile
  src/Makefile
])

